import request from './request'
const rootUrl = import.meta.env.VITE_APP_URL

export default {
  //公用接口
  //文件批量下载
  batchDownloadFiles: data => {
    return request({
      url: `/system/api/sysFiles/download/fileIds`,
      method: 'post',
      data,
      responseType: 'blob',
    })
  },
  //获取文件url
  getFileUrl: data => {
    return request({
      url: `/system/api/sysFiles/look/${data.fileId}`,
      method: 'get',
    })
  },
  //工单统计-业务报告
  //获取业务报告
  getBusinessReport: data => {
    return request({
      url: `/workorder/api/actHiProcinst/statistics`,
      method: 'post',
      data,
    })
  },
  //业务报告导出
  getBusinessReportExport: data => {
    return request({
      url: `/workorder/api/actHiProcinst/business/export`,
      method: 'post',
      data,
      responseType: 'blob',
    })
  },

  //工单统计-VPN自动打网
  //获取工单列表
  getOrderList: data => {
    return request({
      url: `/workorder/api/actHiProcinst/list`,
      method: 'post',
      data,
    })
  },
  //获取流程分类下拉列表
  getProcessClassificationSelectList: data => {
    return request({
      url: `/workorder/api/wfCategory/list`,
      method: 'post',
      data,
    })
  },
  //工单导出
  orderExport: data => {
    return request({
      url: `/workorder/api/actHiProcinst/export`,
      method: 'post',
      data,
      responseType: 'blob',
    })
  },
  //下发命令
  issueAnOrder: data => {
    return request({
      url: `/workorder/api/actHiProcinst/instructionIssued`,
      method: 'post',
      data,
    })
  },
  //获取工单详情
  getOrderDetails: data => {
    return request({
      url: `/workorder/api/actHiProcinst/detail/${data}`,
      method: 'get',
    })
  },
  //知识库-文档管理
  //获取知识库文件夹列表
  getKnowledgeBaseFolderList: data => {
    return request({
      url: `/system/api/sysDocument/tree`,
      method: 'post',
      data,
    })
  },
  //新增知识库文件夹列表
  addKnowledgeBaseFolderList: data => {
    return request({
      url: `/system/api/sysDocument/add`,
      method: 'post',
      data,
    })
  },
  //编辑知识库文件夹列表
  editKnowledgeBaseFolderList: data => {
    return request({
      url: `/system/api/sysDocument/edit`,
      method: 'post',
      data,
    })
  },
  //删除知识库文件夹列表
  delKnowledgeBaseFolderList: data => {
    return request({
      url: `/system/api/sysDocument/remove`,
      method: 'post',
      data,
    })
  },
  //获取常用知识库
  getCommonKnowledgeBase: () => {
    return request({
      url: `/system/api/knowledgeBase/frequently/used`,
      method: 'get',
    })
  },
  //获取知识库文件列表
  getKnowledgeBaseFileList: data => {
    return request({
      url: `/system/api/knowledgeBase/list`,
      method: 'post',
      data,
    })
  },
  //上传知识库文件
  uploadTheKnowledgeBaseFileUrl: '/system/api/knowledgeBase/upload',
  //上传文件夹
  uploadFolderUrl: '/system/api/knowledgeBase/upload-folder',
  //新增或移除个人收藏
  addOrRemovePersonalCollections: data => {
    return request({
      url: `/system/api/userCollect/add/${data.id}`,
      method: 'get',
    })
  },
  //删除知识库文件
  delKnowledgeBaseFileList: data => {
    return request({
      url: `/system/api/knowledgeBase/remove`,
      method: 'post',
      data,
    })
  },
  //增加知识库使用次数
  increaseUsageFrequencyKnowledgeBase: data => {
    return request({
      url: `/system/api/knowledgeBase/addUseCount/${data.id}`,
      method: 'get',
    })
  },
  //新建文件
  createFile: data => {
    return request({
      url: `/system/api/knowledgeBase/create`,
      method: 'post',
      data,
    })
  },
  //知识库-个人收藏
  //获取个人收藏列表
  getPersonalCollection: data => {
    return request({
      url: `/system/api/userCollect/list`,
      method: 'post',
      data,
    })
  },
  //知识库-模板管理
  //获取模板列表
  getTemplateList: data => {
    return request({
      url: `/system/api/knowledgeBase/template/list`,
      method: 'post',
      data,
    })
  },
  //获取模板类型列表
  getTemplateTypeList: data => {
    return request({
      url: `/system/api/knowledgeBase/template/type`,
      method: 'get',
      data,
    })
  },
  //删除模板列表
  delTemplateList: data => {
    return request({
      url: `/system/api/knowledgeBase/template/remove`,
      method: 'post',
      data,
    })
  },
  //模板上传
  tamplateUploadUrl: '/system/api/knowledgeBase/template/upload',
  //巡检管理-巡检任务
  //获取巡检任务类型列表
  getInspectionTaskTypeList: () => {
    return request({
      url: `/inspection/api/inspectionTask/taskType`,
      method: 'get',
    })
  },
  //获取资源类型列表
  getIResourceTypeList: () => {
    return request({
      url: `/inspection/api/inspectionTask/resourceType`,
      method: 'get',
    })
  },
  //获取资源类型列表
  getSchedulingTypeList: () => {
    return request({
      url: `/inspection/api/inspectionTask/scheduleType`,
      method: 'get',
    })
  },
  //获取巡检任务列表
  getInspectionTaskList: data => {
    return request({
      url: `/inspection/api/inspectionTask/page`,
      method: 'post',
      data,
    })
  },
  //新增巡检任务
  addInspectionTask: data => {
    return request({
      url: `/inspection/api/inspectionTask/add`,
      method: 'post',
      data,
    })
  },
  //获取资源列表
  getResourcesList: data => {
    return request({
      url: `/inspection/api/inspectionTask/getResourceList`,
      method: 'post',
      data,
    })
  },
  //获取巡检任务详情
  getInspectionTaskInfo: data => {
    return request({
      url: `/inspection/api/inspectionTask/info/${data.id}`,
      method: 'get',
    })
  },
  //编辑巡检任务
  editInspectionTask: data => {
    return request({
      url: `/inspection/api/inspectionTask/edit`,
      method: 'post',
      data,
    })
  },
  //删除巡检任务
  delInspectionTask: data => {
    return request({
      url: `/inspection/api/inspectionTask/delete`,
      method: 'post',
      data,
    })
  },
  //启动或停止巡检任务
  startOrStopInspectionTask: data => {
    return request({
      url: `/inspection/api/inspectionTask/startOrStop/${data.id}`,
      method: 'get',
    })
  },
  //巡检管理-巡检记录
  //获取巡检记录列表
  getInspectionRecordList: data => {
    return request({
      url: `/inspection/api/inspectionRecord/page`,
      method: 'post',
      data,
    })
  },
  //删除巡检任务
  delInspectionRecord: data => {
    return request({
      url: `/inspection/api/inspectionRecord/delete`,
      method: 'post',
      data,
    })
  },
  //巡检管理-巡检结果-巡检异常项
  //获取巡检异常项列表
  getInspectionAnomalyList: data => {
    return request({
      url: `/inspection/api/inspectionAlarm/page`,
      method: 'post',
      data,
    })
  },
  //删除巡检异常项
  delInspectionAnomalyList: data => {
    return request({
      url: `/inspection/api/inspectionAlarm/delete`,
      method: 'post',
      data,
    })
  },
  //导出巡检异常项
  exportInspectionAnomalyList: data => {
    return request({
      url: `/inspection/api/inspectionAlarm/export`,
      method: 'post',
      responseType: 'blob',
      data,
    })
  },
  //巡检管理-巡检结果-异常资源
  //获取异常资源列表
  getAbnormalResourcesList: data => {
    return request({
      url: `/inspection/api/alarmResource/page`,
      method: 'post',
      data,
    })
  },
  //删除异常资源列表
  delAbnormalResourcesList: data => {
    return request({
      url: `/inspection/api/alarmResource/delete`,
      method: 'post',
      data,
    })
  },
  //导出异常资源列表
  exportAbnormalResourcesList: data => {
    return request({
      url: `/inspection/api/alarmResource/export`,
      method: 'post',
      data,
    })
  },
  //巡检管理-巡检结果-巡检报告
  //获取巡检报告列表
  getInspectionReportList: data => {
    return request({
      url: `/inspection/api/inspectionReport/page`,
      method: 'post',
      data,
    })
  },
  //日志-操作日志
  //获取操作日志
  getOperationLogList: data => {
    return request({
      url: `/system/api/operlog/list`,
      method: 'post',
      data,
    })
  },
  //日志-系统日志
  //获取系统日志
  getSystemLogList: data => {
    return request({
      url: `/inspection/api/sysLog/sysLog/list`,
      method: 'post',
      data,
    })
  },

  //其他-城市大脑
  //获取云盾告警信息展示
  getCloudShieldAlertInformation: data => {
    return request({
      url: `/inspection/api/largeScreen/thisWeekList`,
      method: 'post',
      data,
    })
  },
  //获取设备状态概览
  getOverviewEquipmentStatus: data => {
    return request({
      url: `/inspection/api/largeScreen/device/count`,
      method: 'post',
      data,
    })
  },
  //获取阿里云资源使用情况
  getUsageAlibabaCloudResources: data => {
    return request({
      url: `/inspection/api/largeScreen/aliyun/resource/statistics`,
      method: 'post',
      data,
    })
  },
  //获取云盾告警实时列表
  getRealtimeListCloudShieldAlerts: data => {
    return request({
      url: `/inspection/api/largeScreen/alarmList`,
      method: 'post',
      data,
    })
  },
  //获取工单系统数据展示
  getWorkOrderSystemData: data => {
    return request({
      url: `/inspection/api/largeScreen/workorder/statistics/${data}`,
      method: 'get',
    })
  },
  //其他-智能助手
  //获取智能助手消息
  getDeepseekInfo: `${rootUrl}/deepseek/api/v1/chat/completions`,
}
